<!DOCTYPE HTML>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<!--[if lt IE 9]>
<script type="text/javascript" src="__ADMIN__/__ADMIN__/static/admin/static/admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="__ADMIN__/__ADMIN__/static/admin/static/admin/lib/respond.min.js"></script>
<![endif]-->
		<link rel="stylesheet" type="text/css" href="__ADMIN__/static/admin/static/h-ui/css/H-ui.min.css" />
		<link rel="stylesheet" type="text/css" href="__ADMIN__/static/admin/static/h-ui.admin/css/H-ui.admin.css" />
		<link rel="stylesheet" type="text/css" href="__ADMIN__/static/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="__ADMIN__/static/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
		<link rel="stylesheet" type="text/css" href="__ADMIN__/static/admin/static/h-ui.admin/css/style.css" />
		<!--[if IE 6]>
<script type="text/javascript" src="__ADMIN__/__ADMIN__/static/admin/static/admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
		<title>分类管理</title>
	</head>

	<body>
		<nav class="breadcrumb">
			<i class="Hui-iconfont"></i> 首页
			<span class="c-gray en">&gt;</span> 产品管理
			<span class="c-gray en">&gt;</span> 分类管理
			<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
		</nav>

		<div class="page-container">
			<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
				<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont"></i> 批量删除</a> 
				<a class="btn btn-primary radius" onclick="product_add('添加分类','{:url("admin/productcategory/add")}')" href="javascript:;"><i class="Hui-iconfont"></i> 添加产品</a></span> <span class="r">共有数据：<strong>54</strong> 条</span> </div>
			<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
				<thead>
					<tr class="text-c" role="row">
						<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name="" value=""></th>
						<th width="80" class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" aria-label="ID: 升序排列" style="width: 80px;">ID</th>

						<th width="80" class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="分类: 升序排列" style="width: 80px;">分类名称</th>

						<th width="120" class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="更新时间: 升序排列" style="width: 120px;">更新时间</th>

						<th width="120" class="sorting_disabled" rowspan="1" colspan="1" aria-label="操作" style="width: 120px;">操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name='cates' id='vo'}
					<tr class="text-c odd" role="row">
						<td><input type="checkbox" value="" name=""></td>
						<td class="sorting_1">{:$vo.id}</td>
						<td>{:$vo.goods_cate_name}</td>
						<td>{:$vo.create_time}</td>

						<td class="f-14 td-manage">
							<a style="text-decoration:none" class="ml-5" onclick="product_edit('分类修改','{:url('admin/productcategory/update')}','{:$vo.id}')" href="javascript:;" title="编辑"><i class="Hui-iconfont"></i></a>
							<a style="text-decoration:none" class="ml-5" onclick="article_del(this,'{:$vo.id}')" href="javascript:;" title="删除"><i class="Hui-iconfont"></i></a>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
		</div>
		<script type="text/javascript" src="__ADMIN__/static/admin/lib/jquery/1.9.1/jquery.min.js"></script>
		<script type="text/javascript" src="__ADMIN__/static/admin/lib/layer/2.4/layer.js"></script>
		<script type="text/javascript" src="__ADMIN__/static/admin/static/h-ui/js/H-ui.min.js"></script>
		<script>
			/*产品-删除*/
			function article_del(obj, id) {
				layer.confirm('确认要删除吗？', function(index) {
					$.ajax({
						type: 'POST',
						url: '{:url("admin/productcategory/articledelete")}',
						data: {
							id: id
						},
						dataType: 'json',
						success: function(data) {
//							alert(data);return false;
							if(data == 20000 || data == '20000') {
								$(obj).parents("tr").remove();
								layer.msg('已删除!', {
									icon: 1,
									time: 1000
								});
							} else {
								layer.msg('删除失败!', {
									icon: 2,
									time: 1000
								});
							}

						},
						error: function(data) {
							console.log(data.msg);
						},
					});
				});
			}
			function product_edit(title,url,id){
				var index = layer.open({
					type: 2,
					title: title,
					content: url+'?'+'id='+id
				});
				layer.full(index);
			}
			function product_add(title,url){
				var index = layer.open({
					type: 2,
					title: title,
					content: url
				});
				layer.full(index);
			}
		</script>
	</body>

</html>